package com.vhall.component.service.export.handler;

import com.vhall.component.entity.export.ExportEntity;
import com.vhall.component.entity.export.dto.AdminExportRoomQueryCondition;
import com.vhall.component.service.room.RoomInnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * admin-房间导出
 *
 * @author yuanzh
 */
@Component("adminExportHandler_1")
public class AdminExportRoomHandler implements BaseAdminExportHandler {

    private static final String FILE_NAME = "房间列表";

    @Autowired
    private RoomInnerService roomInnerService;

    @Override
    public String getFileName() {
        return FILE_NAME;
    }

    @Override
    public int count(ExportEntity entity) {
        return roomInnerService.countRoomForAdminExport(AdminExportRoomQueryCondition.convertTo(entity.getParams()));
    }
}
